package paywithdrawlogic

import (
	"context"

	"gitee.com/liuxuezhan/ar-platform/assets-rpc/internal/dao/model/withdraw"
	"gitee.com/liuxuezhan/ar-platform/assets-rpc/internal/svc"
	"gitee.com/liuxuezhan/ar-platform/assets-rpc/rpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type UserAuthAddLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewUserAuthAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserAuthAddLogic {
	return &UserAuthAddLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// -------------------------实名认证-------------------------------
func (l *UserAuthAddLogic) UserAuthAdd(in *rpc.UserAuthAddReq) (ret *rpc.UserAuthAddRes, err error) {
	ret = &rpc.UserAuthAddRes{}
	m := withdraw.NewUserAuthModel(l.ctx, l.svcCtx.Db)
	ret.Data, err = m.UserAuthModelAdd(in.GetData())
	if err != nil {
		return nil, err
	}
	return ret, nil
}
